<template>

	<view class="uni-flex uni-flex-item uni-column">
		<text v-for="(item, index) in students" @click="menuClick" :id="index" :data-name="item.name" :data-age="item.age" :key="index">
			{{index}} - {{item.name}} - {{item.age}}
		</text>
	</view>

</template>
<script>
	export default {
		data: {
			students: [{
					name: "张三",
					age: 18
				},
				{
					name: "李四",
					age: 20
				}
			]
		},
		methods: {
			menuClick: function (e) {
				// console.log(e);
				console.log(e.target.id);
				console.log(e.target.dataset.name);
				console.log(e.target.dataset.age);

			}
		},
	}
</script>
<style>
	@import "../../common/uni.css";
</style>
